home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / monochrome.swf / scripts / frame_10 / PlaceObject2_508_538 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2005-08-26  |  2.6 KB  |  104 lines

  1. onClipEvent(enterFrame){
  2.    if(_name != "shipWARP2")
  3.    {
  4.       if(_currentframe == 1)
  5.       {
  6.          if(began == 0)
  7.          {
  8.             _Y = _Y + 3;
  9.             if(_Y > 100)
  10.             {
  11.                began = 1;
  12.             }
  13.          }
  14.          else
  15.          {
  16.             xspeed = speed * Math.sin((_rotation * -1 + 180) * 0.017453292519943295);
  17.             yspeed = speed * Math.cos((_rotation * -1 + 180) * 0.017453292519943295);
  18.             _X = _X + xspeed;
  19.             _Y = _Y + yspeed;
  20.             if(wp._currentframe == 3)
  21.             {
  22.                _X = _X + 100 * Math.sin((_rotation * -1 + 180) * 0.017453292519943295);
  23.                _Y = _Y + 100 * Math.cos((_rotation * -1 + 180) * 0.017453292519943295);
  24.             }
  25.             if(wp._currentframe == 1)
  26.             {
  27.                _rotation = _rotation + rspeed * speed;
  28.             }
  29.             xx = random(10);
  30.             if(xx == 0)
  31.             {
  32.                rspeed *= -1;
  33.             }
  34.             xx = random(100);
  35.             if(xx == 0)
  36.             {
  37.                speed = 14;
  38.                rspeed = 1.2;
  39.                timer = 100 + random(50);
  40.             }
  41.             ww = random(50);
  42.             if(ww == 0)
  43.             {
  44.                wp.play();
  45.             }
  46.             timer -= 1;
  47.             if(timer == 0)
  48.             {
  49.                speed = 7;
  50.                rspeed = 0.6;
  51.             }
  52.             yy = random(75);
  53.             if(yy == 0)
  54.             {
  55.                _root.fire2(this);
  56.             }
  57.             if(_X < rad)
  58.             {
  59.                _rotation = -1 * _rotation;
  60.                _X = rad;
  61.             }
  62.             if(_X > 550 - rad)
  63.             {
  64.                _rotation = -1 * _rotation;
  65.                _X = 550 - rad;
  66.             }
  67.             if(_Y > 400 - rad)
  68.             {
  69.                _rotation = -1 * _rotation + 180;
  70.                _Y = 400 - rad;
  71.             }
  72.             if(_Y < rad)
  73.             {
  74.                _rotation = -1 * _rotation + 180;
  75.                _Y = rad;
  76.             }
  77.             if(_root.ship.sh.hitTest(wp.sh.harea))
  78.             {
  79.                _root.ship.play();
  80.             }
  81.          }
  82.          var i = 0;
  83.          while(i <= 20)
  84.          {
  85.             if(wp.sh.harea.hitTest(_root["hmn" + i]))
  86.             {
  87.                life -= _root["hmn" + i].dmg;
  88.                wp.sh.play();
  89.                removeMovieClip(_root["hmn" + i]);
  90.             }
  91.             i++;
  92.          }
  93.          if(life <= 0)
  94.          {
  95.             play();
  96.          }
  97.       }
  98.       if(_root.rem == true)
  99.       {
  100.          removeMovieClip(this);
  101.       }
  102.    }
  103. }
  104.